package com.gaohe.dcp.service.impl;

import java.util.List;
import com.gaohe.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gaohe.dcp.mapper.DcpHospitalMapper;
import com.gaohe.dcp.domain.DcpHospital;
import com.gaohe.dcp.service.IDcpHospitalService;

/**
 * 医院信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-23
 */
@Service
public class DcpHospitalServiceImpl implements IDcpHospitalService 
{
    @Autowired
    private DcpHospitalMapper dcpHospitalMapper;

    /**
     * 查询医院信息
     * 
     * @param hospitalId 医院信息主键
     * @return 医院信息
     */
    @Override
    public DcpHospital selectDcpHospitalByHospitalId(Long hospitalId)
    {
        return dcpHospitalMapper.selectDcpHospitalByHospitalId(hospitalId);
    }

    /**
     * 查询医院信息列表
     * 
     * @param dcpHospital 医院信息
     * @return 医院信息
     */
    @Override
    public List<DcpHospital> selectDcpHospitalList(DcpHospital dcpHospital)
    {
        return dcpHospitalMapper.selectDcpHospitalList(dcpHospital);
    }

    /**
     * 新增医院信息
     * 
     * @param dcpHospital 医院信息
     * @return 结果
     */
    @Override
    public int insertDcpHospital(DcpHospital dcpHospital)
    {
        dcpHospital.setCreateTime(DateUtils.getNowDate());
        return dcpHospitalMapper.insertDcpHospital(dcpHospital);
    }

    /**
     * 修改医院信息
     * 
     * @param dcpHospital 医院信息
     * @return 结果
     */
    @Override
    public int updateDcpHospital(DcpHospital dcpHospital)
    {
        dcpHospital.setUpdateTime(DateUtils.getNowDate());
        return dcpHospitalMapper.updateDcpHospital(dcpHospital);
    }

    /**
     * 批量删除医院信息
     * 
     * @param hospitalIds 需要删除的医院信息主键
     * @return 结果
     */
    @Override
    public int deleteDcpHospitalByHospitalIds(Long[] hospitalIds)
    {
        return dcpHospitalMapper.deleteDcpHospitalByHospitalIds(hospitalIds);
    }

    /**
     * 删除医院信息信息
     * 
     * @param hospitalId 医院信息主键
     * @return 结果
     */
    @Override
    public int deleteDcpHospitalByHospitalId(Long hospitalId)
    {
        return dcpHospitalMapper.deleteDcpHospitalByHospitalId(hospitalId);
    }
}
